package com.ac.action;

import java.util.List;

import com.ac.entity.PN;
import com.ac.entity.Parts;
import com.ac.entity.PartsType;
import com.ac.util.DataStore;



public class AjaxAction extends DefaultAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<PartsType> partsTypeList;
	private List<Parts> partsList;
	private List<PN> pnList;
	
	private String id;//common id
	
	
	public String partsType(){
		partsTypeList = DataStore.getPartsTypeList();
		
		return "partsType";
	}
	
	public String parts(){
		
		partsTypeList = DataStore.getPartsTypeList();
		for(int i = 0 ; i < partsTypeList.size();i++){
			if(id.equals(partsTypeList.get(i).getId()+"")){
				partsList = partsTypeList.get(i).getPartsList();
				break;
			}
		}
		return "parts";
	}
	
	public String pn(){
		pnList = this.getHibernateBaseDao().getAllList(PN.class);
		return "pn";
	}


	public List<PartsType> getPartsTypeList() {
		return partsTypeList;
	}


	public void setPartsTypeList(List<PartsType> partsTypeList) {
		this.partsTypeList = partsTypeList;
	}


	public String getId() {
		return id;
	}


	public void setId(String id) {
		this.id = id;
	}

	public List<Parts> getPartsList() {
		return partsList;
	}

	public void setPartsList(List<Parts> partsList) {
		this.partsList = partsList;
	}

	public List<PN> getPnList() {
		return pnList;
	}

	public void setPnList(List<PN> pnList) {
		this.pnList = pnList;
	}


	
}
